﻿@using Nop.Core;
@using Nop.Web.Framework;
@using Nop.Plugin.Payments.LibraPay.Models;
@model AuthorizeModel

@{
	Layout = "~/Views/Shared/_ColumnsOne.cshtml";
}

<link href="~/Plugins/Payments.LibraPay/styles.css" rel="stylesheet" />

<h2>@T("Plugins.Payments.LibraPay.Shopper.Redirect0")</h2>
<p>@T("Plugins.Payments.LibraPay.Shopper.Redirect1")</p>
<p>@T("Plugins.Payments.LibraPay.Shopper.Redirect2")</p>
<p>@T("Plugins.Payments.LibraPay.Shopper.Redirect3")</p>
<p>@T("Plugins.Payments.LibraPay.Shopper.Redirect4")</p>

<table border="0" id="LibraPay_OrderSummary">
	<tr valign="top" style="visibility:hidden;">
		<td>@T("Plugins.Payments.LibraPay.Shopper.MerchantName"):</td>
		<td><b>@Model.MERCH_NAME</b></td>
	</tr>
	<tr valign="top">
		<td>@T("Plugins.Payments.LibraPay.Shopper.OrderID")</td>
		<td>@Model.OrderID</td>
	</tr>
	<tr valign="top">
		<td>@T("Plugins.Payments.LibraPay.Shopper.OrderDescription"):</td>
		<td><b>@Model.Description</b></td>
	</tr>
	<tr valign="top">
		<td>@T("Plugins.Payments.LibraPay.Shopper.Amount"):</td>
		<td><b>@Model.Amount.ToString("#,##0.00")</b> @Model.CURRENCY</td>
	</tr>
	<tr valign="top" style="visibility:hidden;">
		<td>@T("Plugins.Payments.LibraPay.Shopper.MerchantURL"):</td>
		<td>@Model.MERCH_URL</td>
	</tr>
</table>
@Html.Raw(Model.OrderItems)
@if (Model.UseSandbox)
{
	<p><b>Security token P_SIGN</b><br />@Model.P_SIGN</p>
	<p><b>Message hashed into P_SIGN</b></p>
	<textarea rows="5" readonly="readonly" wrap="hard" style="width: 100%;">@Model.MessageToHashOnAuthorizeRequest</textarea>
	<p><b>Order details sent as encoded JavaScript</b></p>
	<textarea rows="5" readonly="readonly" wrap="hard" style="width: 100%;">@Model.OrderDetailsSerializedAsJavaScript</textarea>
}

<form action="@Model.PaymentGatewayURL" method="post" name="PaymentForm">
	<input type="hidden" name="AMOUNT" value="@Model.AMOUNT" />
	<input type="hidden" name="CURRENCY" value="@Model.CURRENCY" />
	<input type="hidden" name="ORDER" value="@Model.ORDER" />
	<input type="hidden" name="DESC" value="@Model.DESC" />
	<input type="hidden" name="TERMINAL" value="@Model.TERMINAL" />
	<input type="hidden" name="TIMESTAMP" value="@Model.TIMESTAMP" />
	<input type="hidden" name="NONCE" value="@Model.NONCE" />
	<input type="hidden" name="BACKREF" value="@Model.BACKREF" />
	<input type="hidden" name="DATA_CUSTOM" value="@Model.DATA_CUSTOM" />
	<input type="hidden" name="P_SIGN" value="@Model.P_SIGN" />
	<p><input type="submit" class="button-1 add-to-cart-button" value="@T("Plugins.Payments.LibraPay.Shopper.RedirectSubmitButton")" /></p>
</form>
